home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / cgazv3n4.zip / DIF-DIR.ZIP / DB3DATA.H next >
Text File  |  1989-04-23  |  2KB  |  48 lines

  1. /*************************** DB3DATA.H ************************
  2. *   Data #defines for dBase III side of dif.c 
  3. *   (c) Copyright Victor Volkman, 1989. See dif.c for terms
  4. **************************************************************/
  5.  
  6. #define DB3_CHAR    'C'
  7. #define DB3_NUMERIC 'N'
  8. #define DB3_LOGICAL 'L'
  9. #define DB3_MEMO    'M'
  10. #define DB3_DATE    'D'
  11. #define DB3_NONE    '\0'
  12.  
  13. #define DB3_DATE_SIZE    8
  14. #define DB3_LOGICAL_SIZE 1
  15. #define DB3_DEFAULT_SIZE 1 /* field size for empty vectors, customize for */
  16.                            /* your application                            */
  17. #define DB3_HDR_SIZE 32    /* Header portion preceding the field descriptors */
  18. #define DB3_HDR_ACTUAL_SIZE 22  /* Only 22 bytes formally defined */
  19. #define DB2_HDR_SIZE 520
  20. #define DB3_NAME_LEN 11    /* field name length */
  21. #define DB3_FILE_TYPE 0x03
  22. #define DB2_FILE_TYPE 0x02
  23.  
  24. #define UPD_YY 0       /* Date format for last_upd field */
  25. #define UPD_MM 1
  26. #define UPD_DD 2
  27.  
  28.  
  29. typedef struct {   /* One of these structures per database field */
  30.    char fld_name[DB3_NAME_LEN];  /* Letters & digits, no spaces    */
  31.    char fld_type;                /* DB3_CHAR, DB3_NUMERIC, ...     */
  32.    long fld_data_addr;           /* Scratchpad field address       */
  33.    char fld_size;                /* field size in bytes            */
  34.    char fld_dec_cnt;             /* Number of places after decimal */
  35.    char reserved[4];
  36.    } db3_hdr_elt, *db3_hdr_elt_p;
  37.  
  38. typedef struct {   /* One of these structures per database file */
  39.    char ver_no;           /* dBase III id                          */
  40.    char last_upd[3];      /* Date of last update YY/MM/DD          */
  41.    long num_recs;         /* Number of records == number of tuples */
  42.    int size_hd;           /* Total header size                     */
  43.    int size_rec;          /* Size of a database record             */
  44.    char reserved[20];
  45.    db3_hdr_elt_p fld;     /* this field not actually in db3 header */
  46.    char *data;            /* this field not actually in db3 header */
  47.    } db3_hdr, *db3_hdr_p;
  48.